<template>
  <div class="rent-page">
    <van-nav-bar
      style="background-color: skyblue"
      title="房屋管理"
      left-arrow
      @click-left="$router.back()"
    />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
    <Arent
        v-for="item in list"
        :key="item.id"
        :item="item"
      ></Arent>
    </van-list>
  </div>
</template>

<script>
import Arent from '@/components/Arent.vue'
import {getRent} from '@/api/user'
export default {
  components:{
    Arent
  },
  name: 'rent-page',
  data () {
    return {
      list:[],
      loading:false,
      finished:false
    }
  },
  methods: {
         async onLoad(){
          const {body}= await getRent()
          this.list.push(...body)
          // console.log(res);
         }
  }
}
</script>

<style lang="less" scoped>
.rent-page {
  color: #069;
  margin-bottom: 50px;
}
</style>